//
//  xiangqinCell.m
//  lyxluyou
//
//  Created by mmyy on 15/10/16.
//  Copyright (c) 2015年 mmyy. All rights reserved.
//

#import "xiangqinCell.h"

@implementation xiangqinCell

- (void)awakeFromNib {
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createCell];
    }
    return self;

}
-(void)createCell
{
    self.headImage = [UIImageView new];
    self.headImage.layer.cornerRadius = 20;
    self.headImage.layer.masksToBounds = YES;
    [self.contentView addSubview:self.headImage];
    
    
    self.uname = [UILabel new];
    self.uname.textColor = [UIColor blackColor];
    self.uname.font = [UIFont systemFontOfSize:10];
    self.uname.adjustsFontSizeToFitWidth = YES;
    [self.contentView addSubview:self.uname];
    
    
    self.vname = [UILabel new];
    self.vname.textColor = [UIColor blueColor];
    self.vname.adjustsFontSizeToFitWidth = YES;
    self.vname.font = [UIFont systemFontOfSize:10];
    [self.contentView addSubview:self.vname];
    
    self.detaTime = [UILabel new];
    self.detaTime.textColor = [UIColor darkGrayColor];
    self.detaTime.alpha = 0.6;
    self.detaTime.font = [UIFont systemFontOfSize:10];
    [self.contentView addSubview:self.detaTime];
    
    self.trip = [UILabel new];
    self.trip.textColor = [UIColor blackColor];
    self.trip.adjustsFontSizeToFitWidth = YES;
    self.trip.numberOfLines = 0;
    self.trip.lineBreakMode = NSLineBreakByWordWrapping;
    self.trip.font = [UIFont systemFontOfSize:10];
    [self.contentView addSubview:self.trip];
    
    
    self.scrollView = [[UIScrollView alloc] init];
    [self.contentView addSubview:self.scrollView];
    self.scrollView.userInteractionEnabled = YES;
    [self.headImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.top).offset(10);
        make.left.equalTo(self.left).offset(10);
        make.width.equalTo(@40);
        make.height.equalTo(@40);
    }];
    [self.uname mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.headImage.right).offset(10);
        make.top.equalTo(self.top).offset(15);
        make.width.equalTo(@150);
        make.height.equalTo(@15);
        make.bottom.equalTo(self.vname.top).offset(-5);
        
    }];
    [self.vname mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.headImage.right).offset(10);
        make.width.equalTo(150);
        make.height.equalTo(@15);
        
    }];
    
    [self.detaTime mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.right).offset(10);
        make.top.equalTo(self.top).offset(10);
        make.width.equalTo(@80);
        make.height.equalTo(15);
    }];
    
//    iew *scrollView;

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
